<?php
/**
 ***** 扶摇而上、抱守本真 ******
 * @author Dana
 * @Date 2021/6/28
 */

$db = new PDO('mysql:host=localhost;dbname=test','test','123456');

$window = '-7';

$sth = $db->prepare('Delete from users where verified = 0 and '."create < datetime('now',?)");

$res = $sth->execute([$window]);

if($res){
    print "deactivated ".$sth->rowCount(). "users.\n";
}else{
    print "can't delete users.'n";
}
